using System;
using System.Collections.Generic;
using System.Reflection;
using System.Windows.Forms;
using log4net;

namespace BTSDecompress
{
    static class Program
    {
        static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            try
            {
                // Enable logging
                log4net.Config.XmlConfigurator.Configure();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                log.Debug("Starting up");
                if (args.Length > 0 && args[0] == "-p")
                {
                    Application.Run(new GetTrackedMessage(false));
                }
                else
                {
                    Application.Run(new GetTrackedMessage());
                }
                log.Debug("Closing down");
            }
            catch (Exception ex)
            {
                log.Fatal(ex.Message, ex);
            }
        }
    }
}